#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <assert.h>
#include "util.h"
#include "file_sys.h"


int main(int argc, char** argv){
  char* path;
  if((path=argv[1])==NULL)
  	path=getcwd(NULL,0);
  printf("cwd: %s\n",path);
  file_sys_t cwd_sys= (file_sys_t) emalloc(FS_SIZE);
  init_file_sys(cwd_sys, path, NULL);
  
  char * next_file;
  int i=0;
  while ((next_file=get_next_file(cwd_sys))!=NULL) {
     printf("%d. %s\n",++i, next_file);
       
  }
  close_file_sys(cwd_sys);
  efree(path);
  exit(0);
}
